import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (true){
            String s = sc.nextLine();
            char[] chars = s.toCharArray();
            int sum=0;
            for (int i=0;i<chars.length;i++){
                if (chars[i]=='-'||chars[i]=='+'||chars[i]=='.') {

                }else {
                    int tmp=Integer.valueOf(chars[i])-48;
                    sum+=tmp;
                }
            }
            System.out.println(sum);
        }

    }
}
